<template>
  <div class="app-container">
    <el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" label-width="68px">
      <el-form-item label="锁定" prop="state">
        <el-select v-model="queryParams.state" placeholder="请选择锁定" clearable>
          <el-option v-for="dict in dict.type.common_state" :key="dict.value" :label="dict.label" :value="dict.value" />
        </el-select>
      </el-form-item>
      <el-form-item label="级别" prop="level">
        <el-select v-model="queryParams.level" placeholder="请选择锁定" clearable>
          <el-option v-for="dict in dict.type.level" :key="dict.value" :label="dict.label" :value="dict.value" />
        </el-select>
      </el-form-item>
      <el-form-item label="绘本名称" prop="name">
        <el-input v-model="queryParams.name" placeholder="请输入绘本名称" clearable @keyup.enter.native="handleQuery" />
      </el-form-item>
      <el-form-item label="UNIT" prop="unitName">
        <el-input v-model="queryParams.unitName" :readonly="true" @click.native="openSelectCourse(1)"
          :show-overflow-tooltip="true" />
      </el-form-item>
      <el-form-item>
        <el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button>
        <el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button>
      </el-form-item>
    </el-form>

    <el-row :gutter="10" class="mb8">
      <el-col :span="1.5">
        <el-button type="primary" plain icon="el-icon-plus" size="mini" @click="handleAdd"
          v-hasPermi="['course:picturebook:add']">新增</el-button>
      </el-col>
      <el-col :span="1.5">
        <el-button type="success" plain icon="el-icon-edit" size="mini" :disabled="single" @click="handleUpdate"
          v-hasPermi="['course:picturebook:edit']">修改</el-button>
      </el-col>
      <el-col :span="1.5">
        <el-button type="danger" plain icon="el-icon-delete" size="mini" :disabled="multiple" @click="handleDelete"
          v-hasPermi="['course:picturebook:batchRemove']">删除</el-button>
      </el-col>
      <el-col :span="1.5">
        <el-button type="danger" plain icon="el-icon-lock" size="mini" :disabled="multiple" @click="online"
          v-hasPermi="['course:picturebook:online']">锁定</el-button>
      </el-col>
      <right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
    </el-row>

    <el-table v-loading="loading" :data="contentheadList" @selection-change="handleSelectionChange">
      <el-table-column type="selection" width="55" align="center" />
      <el-table-column label="id" align="center" prop="id" />
      <el-table-column label="绘本名称" align="center" prop="name" />
      <el-table-column label="绘本标签" align="center" prop="tag">
        <template slot-scope="scope">
          <el-tag v-for="(tag,index) in scope.row.tag" :key="scope.row.id+'_tag_'+index" size="mini" class="custom-tag">
            {{tag}}
          </el-tag>
        </template>
      </el-table-column>
      <el-table-column label="级别" align="center" prop="level" />
      <el-table-column label="UNIT" align="center" prop="unitName" />
      <el-table-column label="在线" align="center" prop="state">
        <template slot-scope="scope">
          <dict-tag :options="dict.type.common_state" :value="scope.row.state" />
        </template>
      </el-table-column>
      <el-table-column label="顺序" align="center" prop="sortNo" width="100">
      </el-table-column>
      <el-table-column label="操作" width="400px" align="center" class-name="small-padding fixed-width">
        <template slot-scope="scope">

          <el-button size="mini" v-if="showBtnFun(scope.row)" type="text" icon="el-icon-edit"
            @click="handleUpdate(scope.row)" v-hasPermi="['course:picturebook:edit']">修改</el-button>
          <el-button size="mini" v-if="showBtnFun(scope.row)" type="text" icon="el-icon-delete"
            @click="handleDelete(scope.row)" v-hasPermi="['course:picturebook:remove']">删除</el-button>

          <el-button size="mini" v-if="showBtnFun(scope.row) && scope.row.state==1" type="text" icon="el-icon-unlock"
            @click="online(scope.row)" v-hasPermi="['course:picturebook:online']">锁定</el-button>


          <el-button size="mini" v-if="showBtnFun(scope.row)" type="text" icon="el-icon-edit"
            @click="handleNode(scope.row,'1')" v-hasPermi="['course:picturebook:edit']">课件配置</el-button>

          <el-button size="mini" v-if="showBtnFun(scope.row)" type="text" icon="el-icon-edit"
            @click="setDays(scope.row)" v-hasPermi="['course:picturebook:edit']">作业配置</el-button>


        </template>
      </el-table-column>
    </el-table>

    <pagination v-show="total>0" :total="total" :page.sync="queryParams.pageNum" :limit.sync="queryParams.pageSize"
      @pagination="getList" />

    <!-- 添加或修改课程管理对话框 -->
    <el-dialog :title="title" :visible.sync="open" width="800px" append-to-body>
      <el-form ref="form" :model="form" :rules="rules" label-width="120px">

        <el-form-item label="绘本名称" prop="name">
          <el-input v-model="form.name" :maxlength="50" show-word-limit placeholder="请输入绘本名称" />
        </el-form-item>

        <el-form-item label="绘本标签" prop="tag">
          <el-checkbox-group v-model="form.tag">
            <el-checkbox-button v-for="(item,index) in tag" border :label="String(item)"
              :key="'tag_'+index">{{item}}</el-checkbox-button>
          </el-checkbox-group>
        </el-form-item>

        <el-form-item label="级别" prop="level">
          <el-radio-group v-model="form.level">
            <el-radio-button v-for="dict in dict.type.level" :key="dict.value" :label="dict.label" :value="dict.value"
              border></el-radio-button>
          </el-radio-group>
        </el-form-item>
        <el-form-item label="UNIT" prop="unitName">
          <el-input v-model="form.unitName" @click.native="openSelectCourse(2)" :readonly="true"
            placeholder="点此选择UNIT" />
        </el-form-item>
        <el-form-item label="序号" prop="sortNo">
          <el-input-number v-model="form.sortNo" :min="1" placeholder="请输入顺序(越小越前)" />
        </el-form-item>

        <el-form-item label="封面" prop="coverArray">
          <el-upload :limit="1" :auto-upload="false" action="" :file-list="form.coverArray"
            :on-change="(file, fileList) =>handleChange(file, fileList,'image')" accept="image/*"
            :class="{ uploadIconOne: showImg, uploadIcon: form.coverArray.length>=1 }" list-type="picture-card"
            :on-preview="handlePictureCardPreview"
            :on-remove="(file, fileList) =>handleDeleteFile(file, fileList,'image')">
            <i class="el-icon-plus"></i>
          </el-upload>
        </el-form-item>

        <el-form-item label="视频" prop="videoArray">
          <el-upload :limit="1" :auto-upload="false" action="" ref="videoRef"
            :on-change="(file, fileList) =>handleChange(file, fileList,'video')" list-type="picture-card"
            :class="{ uploadIconOne: showImg, uploadIcon: form.videoArray.length>=1 }"
            :on-remove="(file, fileList) =>handleDeleteFile(file, fileList,'video')" accept="video/*"
            :file-list="form.videoArray">
            <i class="el-icon-plus"></i>
            <div slot="file" slot-scope="{ file }">
              <video :src="file.url" class="full-size-video" controls="controls">
                <span>您的浏览器不支持视频播放</span>
              </video>
              <div class="el-upload-list__item-actions" style="z-index:101;height:40%;">
                <span class="el-upload-list__item-delete" @click="handleDeleteVideo(file)">
                  <i class="el-icon-delete"></i>
                </span>
              </div>
            </div>
          </el-upload>
        </el-form-item>
        <el-form-item label="绘本介绍" prop="introduce">
          <el-input v-model="form.introduce" type="textarea" :maxlength="maxLength" show-word-limit
            placeholder="请输入内容" />
        </el-form-item>
        <el-form-item label="单词" prop="words">
          <el-tag :key="'word_'+index" v-for="(item,index) in form.words" closable :disable-transitions="false"
            @close="handleClose(item)">
            {{item}}
          </el-tag>
          <el-button size="small" :style="{ 'margin-left': form.words.length > 0 ? '20px' : '0' }"
            @click="openSelectWord(1)" icon="el-icon-plus">添加单词</el-button>
        </el-form-item>

        <el-form-item label="句型" prop="sentence">
          <div v-for="(item, index) in form.sentence" :key="index" class="sentence-item">
            <el-input v-model="form.sentence[index]" placeholder="请输入句型"
              style="margin-right: 10px; width: 80%"></el-input>
            <el-button size="small" icon="el-icon-delete" circle @click.prevent="removeSentence(index)"></el-button>
          </div>
          <el-button size="small" icon="el-icon-plus" @click.prevent="addSentence">添加句型</el-button>
        </el-form-item>

        <el-form-item label="REVIEW" prop="reviewFlag">
          <el-select v-model="form.reviewFlag" placeholder="请选择">
            <el-option v-for="dict in dict.type.common_state" :key="dict.value" :label="dict.label"
              :value="parseInt(dict.value)"></el-option>
          </el-select>
        </el-form-item>
        <el-form-item label="显示模块" prop="showModel">
          <el-select v-model="form.showModel" placeholder="请选择">
            <el-option v-for="dict in dict.type.show_model" :key="dict.value" :label="dict.label"
              :value="parseInt(dict.value)"></el-option>
          </el-select>
        </el-form-item>
      </el-form>
      <div slot="footer" class="dialog-footer">
        <el-button type="primary" @click="submitForm" :loading="submitLoading">
          {{ submitLoading ? '提交中...' : '确定' }}</el-button>
        <el-button @click="cancel">取 消</el-button>
      </div>
    </el-dialog>
    <SelectWord ref="selectWord" :open="wordFlag" @selected-data="selectedWordData"
      @close-select-window="closeSelectWord" />
    <manager-node ref="managerNode" v-if="nodeFlag"></manager-node>
    <manager-days ref="managerDays" v-if="daysFlag"></manager-days>
    <!-- 选择课程 -->
    <select-course ref="selectCourseRef" @selected-data="selectedCourseData"></select-course>
    <el-dialog :visible.sync="dialogVisible" title="预览" width="800" append-to-body>
      <img :src="dialogImageUrl" style="display: block; max-width: 100%; margin: 0 auto" />
    </el-dialog>
  </div>
</template>

<script>
  import {
    listContenthead,
    getContenthead,
    delContenthead,
    addContenthead,
    updateContenthead,
    online,
    offline
  } from "@/api/bus_web/course/picturebook";
  import SelectWord from '../../thesaurus/words/select.vue';

  import ManagerNode from "../node/manage_node.vue"
  import ManagerDays from "../plan/manage_days.vue"
  import SelectCourse from "../../course/course/select.vue"
  import {
    isEmpty
  } from "@/utils/validate"
  import {
    mapState
  } from 'vuex';
  import store from "@/store";
  export default {
    name: "PictureBook",
    dicts: ['common_state', 'level', 'show_model'],
    components: {
      SelectWord,
      SelectCourse,
      ManagerNode,
      ManagerDays
    },
    data() {
      return {
        tag: ["人与自然", "人与社会", "人与自我", "复习"],
        wordFlag: false,
        maxLength: 50, // 最大字数限制
        inputVisible: false,
        showImg: true, //默认展示
        inputValue: '',
        submitLoading: false,
        dialogImageUrl: "",
        dialogVisible: false,
        // 遮罩层
        loading: true,
        // 选中数组
        ids: [],
        // 非单个禁用
        single: true,
        // 非多个禁用
        multiple: true,
        // 显示搜索条件
        showSearch: true,
        // 总条数
        total: 0,
        // 课程管理表格数据
        contentheadList: [],
        // 弹出层标题
        title: "",
        // 是否显示弹出层
        open: false,
        //是否显示node节点
        nodeFlag: false,
        daysFlag: false,
        // 查询参数
        queryParams: {
          pageNum: 1,
          pageSize: 10,
          name: null,
          tag: null,
          state: null,
          unitName: null,
          unitIdArray: []
        },
        // 表单参数
        form: {
          id: null,
          name: null,
          tag: [],
          state: null,
          sortNo: 1,
          unitId: null,
          unitName: null,
          introduce: null,
          words: [],
          sentence: [],
          level: null,
          //图片
          coverArray: [],
          videoArray: [],
          showModel: null
        },
        // 表单校验
        rules: {
          name: [{
            required: true,
            message: "绘本不能为空",
            trigger: "blur"
          }],

          level: [{
            required: true,
            message: "级别不能为空",
            trigger: "blur"
          }],
          sortNo: [{
            required: true,
            message: "序号不能为空",
            trigger: "blur"
          }],

          unitName: [{
            required: true,
            message: "不能为空",
            trigger: "blur"
          }],

          tag: [{
            type: 'array',
            required: true,
            message: "请选择标签",
            trigger: "change"
          }],
          showModel: [{
            required: true,
            message: "请选择显示模块",
            trigger: "change"
          }],
          introduce: [{
            required: true,
            message: "介绍不能为空",
            trigger: "blur"
          }],
          reviewFlag: [{
            required: true,
            message: "选择review",
            trigger: "change"
          }],
          videoArray: [{
            type: 'array',
            required: true,
            message: "请上传视频文件",
            trigger: "change"
          }],
          coverArray: [{
            type: 'array',
            required: true,
            message: "请上传封面图片",
            trigger: "change"
          }],
          words: [{
            type: 'array',
            required: true,
            message: "请输入单词",
            trigger: ['change', 'blur'] // 双重触发更可靠
          }]
        }
      };
    },
    computed: {
      ...mapState({
        word: state => state.selectWord.word,
        wordSelectModel: state => state.selectWord.wordSelectModel,

        course: state => state.selectCourse.course,
        courseSelectModel: state => state.selectCourse.courseSelectModel,

      })
    },
    created() {
      this.getList();
    },
    methods: {
      //控制按钮
      showBtnFun(row) {
        if (row.state === 0) {
          if (this.$auth.hasPermi('course:picturebook:online')) {
            return true
          }
        } else {
          return true
        }
        return false
      },
      handleChange(file, fileList, op) {
        if ('image' == op) {
          this.form.coverArray = fileList
          // 触发验证
          this.$nextTick(() => {
            this.$refs.form.validateField('coverArray')
          })
        }
        if ('video' == op) {
          for (var i in this.form.videoArray) {
            let targetFile = fileList[i]
            if (targetFile.url?.startsWith('blob:')) {
              URL.revokeObjectURL(targetFile.url)
            }
          }
          this.form.videoArray = fileList.map((item, index) => {
            return {
              ...item,
              url: isEmpty(item.url) ? URL.createObjectURL(item.raw) : item.url
            };
          })
          // 触发验证
          this.$nextTick(() => {
            this.$refs.form.validateField('videoArray')
          })
        }
      },
      handleDeleteFile(file, fileList, op) {
        if ('image' == op) {
          this.form.coverArray = fileList
          // 触发验证
          this.$nextTick(() => {
            this.$refs.form.validateField('coverArray')
          })
        }
        if ('video' == op) {
          if (file.url?.startsWith('blob:')) {
            URL.revokeObjectURL(file.url)
          }
          this.form.videoArray = fileList
          // 触发验证
          this.$nextTick(() => {
            this.$refs.form.validateField('videoArray')
          })
        }
      },
      //删除视频
      handleDeleteVideo(file) {
        this.$refs.videoRef.handleRemove(file); // 触发组件内部删除逻辑
      },
      //单词
      handleClose(word) {
        const index = this.form.words.indexOf(word)
        if (index > -1) {
          this.form.words.splice(index, 1)
          // 触发验证
          this.$nextTick(() => {
            this.$refs.form.validateField('words')
          })
        }
      },
      //单词输入
      showInput() {
        this.inputVisible = true;
        this.$nextTick(_ => {
          this.$refs.saveWordInput.$refs.input.focus();
        });
      },

      //删除句性
      removeSentence(index) {
        this.form.sentence.splice(index, 1)
      },
      //新增句型
      addSentence() {
        this.form.sentence.push('');
      },
      /** 查询课程管理列表 */
      getList() {
        this.loading = true;
        listContenthead(this.queryParams).then(response => {
          this.contentheadList = response.rows;
          this.total = response.total;
          this.loading = false;
        });
      },
      // 取消按钮
      cancel() {
        this.open = false;
        this.reset();
      },
      // 表单重置
      reset() {
        this.form = {
          id: null,
          name: null,
          tag: [],
          state: 1,
          sortNo: 1,
          introduce: null,
          words: [],
          sentence: [],
          level: null,
          unitId: null,
          unitName: null,
          //图片
          coverArray: [],
          //视频
          videoArray: [],
          showModel: null
        };
        this.resetForm("form");
        this.dialogImageUrl = ""
        this.dialogVisible = false
      },
      /** 搜索按钮操作 */
      handleQuery() {
        this.queryParams.pageNum = 1;
        this.getList();
      },
      /** 重置按钮操作 */
      resetQuery() {
        this.resetForm("queryForm");
        this.queryParams.unitIdArray = []
        this.handleQuery();
      },
      // 多选框选中数据
      handleSelectionChange(selection) {
        this.ids = selection.map(item => item.id)
        this.single = selection.length !== 1
        this.multiple = !selection.length
      },
      /** 新增按钮操作 */
      handleAdd() {
        this.reset();
        this.addSentence();
        this.open = true;
        this.title = "添加绘本";
      },
      /** 修改按钮操作 */
      handleUpdate(row) {
        this.reset();
        const id = row.id || this.ids
        getContenthead(id).then(response => {
          this.form = response.data;
          this.open = true;
          this.title = "修改绘本";
        });
      },
      /** 提交按钮 */
      submitForm() {
        this.submitLoading = true
        this.$refs["form"].validate(valid => {
          if (valid) {
            const formData = new FormData()
            if (!isEmpty(this.form.id)) {
              formData.append('id', this.form.id)
            }
            formData.append('name', this.form.name)
            formData.append('sortNo', this.form.sortNo)
            formData.append('introduce', this.form.introduce)
            formData.append('level', this.form.level)
            formData.append('unitId', this.form.unitId)
            formData.append('reviewFlag', this.form.reviewFlag)
            formData.append('showModel', this.form.showModel)
            //句型
            if (this.form.sentence.length > 0) {
              for (var i in this.form.sentence) {
                if (!isEmpty(this.form.sentence[i])) {
                  formData.append('sentence[' + i + ']', this.form.sentence[i])
                }
              }
            }
            //选择的标签
            for (var i in this.form.tag) {
              formData.append('tag[' + i + ']', this.form.tag[i])
            }
            //输入的单词
            for (var i in this.form.words) {
              formData.append('words[' + i + ']', this.form.words[i])
            }
            for (var i in this.form.coverArray) {
              let file = this.form.coverArray[i]
              if (!isEmpty(file.id)) {
                formData.append('coverArray[' + i + '].id', file.id)
              } else {
                formData.append('coverArray[' + i + '].file', file.raw)
                if (file.url?.startsWith('blob:')) {
                  URL.revokeObjectURL(file.url)
                }
              }
            }
            for (var i in this.form.videoArray) {
              let file = this.form.videoArray[i]
              if (!isEmpty(file.id)) {
                formData.append('videoArray[' + i + '].id', file.id)
              } else {
                formData.append('videoArray[' + i + '].file', file.raw)
                if (file.url?.startsWith('blob:')) {
                  URL.revokeObjectURL(file.url)
                }
              }
            }

            if (this.form.id != null) {
              updateContenthead(formData).then(response => {
                this.$modal.msgSuccess("修改成功");
                this.open = false;
                this.getList();
              }).finally(() => {
                this.submitLoading = false
              })
            } else {
              addContenthead(formData).then(response => {
                this.$modal.msgSuccess("新增成功");
                this.open = false;
                this.getList();
              }).finally(() => {
                this.submitLoading = false
              })
            }
          } else {
            this.submitLoading = false
          }
        });
      },
      /** 删除按钮操作 */
      handleDelete(row) {
        const ids = row.id || this.ids;
        this.$modal.confirm('是否确认删除课程管理编号为"' + ids + '"的数据项？').then(function() {
          return delContenthead(ids);
        }).then(() => {
          this.getList();
          this.$modal.msgSuccess("删除成功");
        }).catch(() => {});
      },
      /** 导出按钮操作 */
      handleExport() {
        this.download('course/contenthead/export', {
          ...this.queryParams
        }, `contenthead_${new Date().getTime()}.xlsx`)
      },
      /**上线*/
      online(row) {
        const ids = row.id || this.ids;
        this.$modal.confirm('是否确认上线绘本编号为"' + ids + '"的数据项？').then(function() {
          return online(ids);
        }).then(() => {
          this.getList();
          this.$modal.msgSuccess("上线成功");
        }).catch(() => {});
      },
      /**下线*/
      offline(row) {
        const ids = row.id || this.ids;
        this.$modal.confirm('是否确认下线绘本编号为"' + ids + '"的数据项？').then(function() {
          return offline(ids);
        }).then(() => {
          this.getList();
          this.$modal.msgSuccess("下线成功");
        }).catch(() => {});
      },
      //删除单词
      handleClose(word) {
        this.form.words.splice(this.form.words.indexOf(word), 1);
        this.$nextTick(() => {
          this.$refs.form.validateField('words')
        })
      },

      //选择等级
      openSelectWord(selectVal) {
        this.wordFlag = true
        // selectVal =1 查询模式 =2 创建、修改模式
        this.$store.dispatch('selectWord/cleanWord')
        this.$store.dispatch('selectWord/setWordSelectModel', selectVal)
      },
      closeSelectWord() {
        this.wordFlag = false
      },
      //确定单词
      selectedWordData() {
        this.closeSelectWord()
        this.form.words = [...new Set([...this.form.words, ...this.word.map(item => item.word)])]
        this.$store.dispatch('selectWord/cleanWord')
        this.$nextTick(() => {
          this.$refs.form.validateField('words')
        })
      },
      //设置Days
      setDays(row) {
        let url = '/course/picturebookdays'
        let params = {
          "id": row.id
        }
        //  this.$tab.openPage('[' + row.name + ']-DAYS', url, params);
        this.daysFlag = true
        this.$nextTick(() => {
          this.$refs.managerDays.init(row)
        })
      },
      /*****nodeType:1-课件,2-作业 3-DAYS*****/
      handleNode(row, nodeType) {
        let title = '课件配置'
        if (2 === nodeType) {
          title = '作业配置'
        }
        let url = '/course/picturebooknode'
        let params = {
          "id": row.id,
          "type": nodeType
        }
        //this.$tab.openPage('[' + row.name + ']-' + title, url, params);

        this.nodeFlag = true
        this.$nextTick(() => {
          this.$refs.managerNode.init(row.id, nodeType, 0, '[' + row.id + '-' + row.name + ']-' + title)
        })
      },
      //选择课程
      openSelectCourse(selectVal) {
        if (selectVal == 1) {
          this.$nextTick(() => {
            // selectVal =1 查询模式 =2 创建、修改模式
            this.$store.dispatch('selectCourse/cleanCourse')
            this.$store.dispatch('selectCourse/setCourseSelectModel', selectVal)
            this.$refs.selectCourseRef.init()
          })
          return
        }
        this.$refs["form"].validateField('level', (valid) => {
          if (!valid) {
            this.$nextTick(() => {
              // selectVal =1 查询模式 =2 创建、修改模式
              this.$store.dispatch('selectCourse/cleanCourse')
              this.$store.dispatch('selectCourse/setCourseSelectModel', selectVal)
              this.$refs.selectCourseRef.init(this.form.level)
            })
          }
        })


      },
      //确定课程
      selectedCourseData() {
        if (this.courseSelectModel == 2) {
          this.form.unitName = this.course[0].name
          this.form.unitId = this.course[0].id
          this.$refs.form.clearValidate(['unitName']);
        } else {
          this.queryParams.unitName = this.course.map(item => item.name).join(',')
          this.queryParams.unitIdArray = this.course.map(item => item.id)
        }
        this.$store.dispatch('selectCourse/cleanCourse')
      }, // 预览
      handlePictureCardPreview(file) {
        this.dialogImageUrl = file.url;
        this.dialogVisible = true;
      },
    }
  };
</script>
<style scoped>
  .word-counter {
    color: #666;
    font-size: 12px;
    text-align: right;
    margin-top: 4px;
  }

  .el-tag+.el-tag {
    margin-left: 10px;
  }

  .button-new-tag {
    height: 32px;
    line-height: 30px;
    padding-top: 0;
    padding-bottom: 0;
  }

  .input-new-tag {
    width: 90px;
    margin-left: 10px;
    vertical-align: bottom;
  }

  .full-size-video {
    width: 100% !important;
    height: 100% !important;
    object-fit: cover;
    position: absolute;
    top: 0;
    left: 0;
  }

  .el-upload-list__item,
  .el-upload-list__item .el-upload-list__item-thumbnail {
    width: 150px;
    height: 120px;
    position: relative;
  }

  .sentence-item {
    display: flex;
    align-items: center;
    margin-bottom: 10px;
  }

  .custom-tag {
    margin-right: 8px;
    /* 设置标签之间的间距 */
  }

  .custom-tag:last-child {
    margin-right: 0;
    /* 最后一个标签不需要右边距 */
  }

  .uploadIcon ::v-deep .el-upload--picture-card {
    display: none !important;
    /* 上传按钮隐藏 */
  }
</style>
